package com.hou;

import java.io.*;
import java.nio.charset.Charset;

public class Test05 {

    public static void main(String[] args) throws IOException {
        //transferTo: 从Reader中读取字符串,按照读取顺序写入到Writer中
        var reader = new FileReader("out.txt");
        var writer = new FileWriter("outNew.txt");
        reader.transferTo(writer);
        writer.flush(); //必须冲刷或者关闭
        writer.close();
    }
}
